home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / CIncludes / Drag.h < prev    next >
C/C++ Source or Header  |  1996-05-01  |  25KB  |  657 lines

  1. /*
  2.      File:        Drag.h
  3.  
  4.      Contains:    Drag and Drop Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.0d3 on Copland DR1
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. */
  18. #ifndef __DRAG__
  19. #define __DRAG__
  20.  
  21. #ifndef __SCRAP__
  22. #include <Scrap.h>
  23. #endif
  24. #ifndef __APPLEEVENTS__
  25. #include <AppleEvents.h>
  26. #endif
  27. #ifndef __QUICKDRAW__
  28. #include <Quickdraw.h>
  29. #endif
  30. #if FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED
  31. #ifndef __TEXTEDIT__
  32. #include <TextEdit.h>
  33. #endif
  34. #ifndef __FILES__
  35. #include <Files.h>
  36. #endif
  37. #ifndef __EVENTS__
  38. #include <Events.h>
  39. #endif
  40. #endif
  41.  
  42. #ifdef __cplusplus
  43. extern "C" {
  44. #endif
  45.  
  46. #if PRAGMA_IMPORT_SUPPORTED
  47. #pragma import on
  48. #endif
  49.  
  50. #if PRAGMA_ALIGN_SUPPORTED
  51. #pragma options align=mac68k
  52. #endif
  53.  
  54. /*
  55. _________________________________________________________________________________________________________
  56.     
  57.  * DRAG MANAGER DATA TYPES
  58.       Currently there are two data types representing a drag in this interface file; ScrapRef and
  59.      DragReference.  It is safe to assume:
  60.      ScrapRef == DragReference
  61.      The two types can be used interchangably throughout the Drag interface file.  ScrapRef is the
  62.      new System 8 Drag Manager data type.  API's that are deprecated for System 8 will always
  63.      take a DragReference as their parameter.
  64.      For now though, use them interchangably.
  65. _________________________________________________________________________________________________________
  66. */
  67. typedef ScrapRef DragReference;
  68. typedef ScrapRef DragScrapRef;
  69. typedef ScrapItemUserReference ItemReference;
  70. typedef ScrapItemType FlavorType;
  71. /*
  72. _________________________________________________________________________________________________________
  73.     
  74.  * DRAG ATTRIBUTES
  75. _________________________________________________________________________________________________________
  76. */
  77. typedef OptionBits DragAttributes;
  78.  
  79. enum {
  80.     kDragHasLeftSenderWindow    = (1L << 0),                    /* drag has left the source window since TrackDrag*/
  81.     kDragInsideSenderApplication = (1L << 1),                    /* drag is occurring within the sender application*/
  82.     kDragInsideSenderWindow        = (1L << 2)                        /* drag is occurring within the sender window*/
  83. };
  84.  
  85. /*
  86. _________________________________________________________________________________________________________
  87.     
  88.  * DRAG IMAGE FLAGS
  89. _________________________________________________________________________________________________________
  90. */
  91. typedef OptionBits DragImageFlags;
  92.  
  93. enum {
  94.     kDragRegionAndImage            = (1L << 4)                        /* drag region and image*/
  95. };
  96.  
  97. /*
  98. _________________________________________________________________________________________________________
  99.     
  100.  * DRAG IMAGE TRANSLUCENCY LEVELS
  101. _________________________________________________________________________________________________________
  102. */
  103. typedef UInt32 DragImageTranslucency;
  104.  
  105. enum {
  106.     kDragStandardTranslucency    = 0L,                            /* 65% image translucency (standard)*/
  107.     kDragDarkTranslucency        = 1L,                            /* 50% image translucency*/
  108.     kDragDarkerTranslucency        = 2L,                            /* 25% image translucency*/
  109.     kDragOpaqueTranslucency        = 3L                            /* 0% image translucency (opaque)*/
  110. };
  111.  
  112. /*
  113. _________________________________________________________________________________________________________
  114.     
  115.  * DRAG DRAWING PROCEDURE MESSAGES
  116. _________________________________________________________________________________________________________
  117. */
  118. typedef SInt16 DragRegionMessage;
  119.  
  120. enum {
  121.     kDragRegionBegin            = 1,                            /* initialize drawing*/
  122.     kDragRegionDraw                = 2,                            /* draw drag feedback*/
  123.     kDragRegionHide                = 3,                            /* hide drag feedback*/
  124.     kDragRegionIdle                = 4,                            /* drag feedback idle time*/
  125.     kDragRegionEnd                = 5                                /* end of drawing*/
  126. };
  127.  
  128. /*
  129. _________________________________________________________________________________________________________
  130.     
  131.  * ZOOM ACCELERATION
  132. _________________________________________________________________________________________________________
  133. */
  134. typedef SInt16 ZoomAcceleration;
  135.  
  136. enum {
  137.     kZoomNoAcceleration            = 0,                            /* use linear interpolation*/
  138.     kZoomAccelerate                = 1,                            /* ramp up step size*/
  139.     kZoomDecelerate                = 2                                /* ramp down step size*/
  140. };
  141.  
  142. #if FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED
  143. /*
  144. _________________________________________________________________________________________________________
  145.     
  146.  * FLAVOR FLAGS
  147. _________________________________________________________________________________________________________
  148. */
  149. typedef OptionBits FlavorFlags;
  150.  
  151. enum {
  152.     flavorSenderOnly            = (1 << 0),                        /* flavor is available to sender only*/
  153.     flavorSenderTranslated        = (1 << 1),                        /* flavor is translated by sender*/
  154.     flavorNotSaved                = (1 << 2),                        /* flavor should not be saved*/
  155.     flavorSystemTranslated        = (1 << 8)                        /* flavor is translated by system*/
  156. };
  157.  
  158. /*
  159. _________________________________________________________________________________________________________
  160.     
  161.  * SPECIAL FLAVORS
  162. _________________________________________________________________________________________________________
  163. */
  164.  
  165. enum {
  166.     flavorTypeHFS                = 'hfs ',                        /* flavor type for HFS data*/
  167.     flavorTypePromiseHFS        = 'phfs',                        /* flavor type for promised HFS data*/
  168.     flavorTypeDirectory            = 'diry'                        /* flavor type for AOCE directories*/
  169. };
  170.  
  171. /*
  172. _________________________________________________________________________________________________________
  173.     
  174.  * DRAG TRACKING HANDLER MESSAGES
  175. _________________________________________________________________________________________________________
  176. */
  177. typedef SInt16 DragTrackingMessage;
  178.  
  179. enum {
  180.     kDragTrackingEnterHandler    = 1,                            /* drag has entered handler*/
  181.     kDragTrackingEnterWindow    = 2,                            /* drag has entered window*/
  182.     kDragTrackingInWindow        = 3,                            /* drag is moving within window*/
  183.     kDragTrackingLeaveWindow    = 4,                            /* drag has exited window*/
  184.     kDragTrackingLeaveHandler    = 5                                /* drag has exited handler*/
  185. };
  186.  
  187. /*
  188. _________________________________________________________________________________________________________
  189.     
  190.  * HFS FLAVORS
  191. _________________________________________________________________________________________________________
  192. */
  193. struct HFSFlavor {
  194.     OSType                             fileType;                    /* file type */
  195.     OSType                             fileCreator;                /* file creator */
  196.     UInt16                             fdFlags;                    /* Finder flags */
  197.     FSSpec                             fileSpec;                    /* file system specification */
  198. };
  199. typedef struct HFSFlavor HFSFlavor;
  200.  
  201. struct PromiseHFSFlavor {
  202.     OSType                             fileType;                    /* file type */
  203.     OSType                             fileCreator;                /* file creator */
  204.     UInt16                             fdFlags;                    /* Finder flags */
  205.     FlavorType                         promisedFlavor;                /* promised flavor containing an FSSpec */
  206. };
  207. typedef struct PromiseHFSFlavor PromiseHFSFlavor;
  208.  
  209. /*
  210. _________________________________________________________________________________________________________
  211.     
  212.  * APPLICATION-DEFINED DRAG HANDLER ROUTINES
  213. _________________________________________________________________________________________________________
  214. */
  215. typedef pascal OSErr (*DragTrackingHandlerProcPtr)(DragTrackingMessage message, WindowPtr theWindow, void *handlerRefCon, DragReference theDrag);
  216.  
  217. #if GENERATINGCFM
  218. typedef UniversalProcPtr DragTrackingHandlerUPP;
  219. #else
  220. typedef DragTrackingHandlerProcPtr DragTrackingHandlerUPP;
  221. #endif
  222.  
  223. enum {
  224.     uppDragTrackingHandlerProcInfo = kPascalStackBased
  225.          | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  226.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(DragTrackingMessage)))
  227.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(WindowPtr)))
  228.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(void *)))
  229.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(DragReference)))
  230. };
  231.  
  232. #if GENERATINGCFM
  233. #define NewDragTrackingHandlerProc(userRoutine)        \
  234.         (DragTrackingHandlerUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppDragTrackingHandlerProcInfo, GetCurrentArchitecture())
  235. #else
  236. #define NewDragTrackingHandlerProc(userRoutine)        \
  237.         ((DragTrackingHandlerUPP) (userRoutine))
  238. #endif
  239.  
  240. #if GENERATINGCFM
  241. #define CallDragTrackingHandlerProc(userRoutine, message, theWindow, handlerRefCon, theDrag)        \
  242.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppDragTrackingHandlerProcInfo, (message), (theWindow), (handlerRefCon), (theDrag))
  243. #else
  244. #define CallDragTrackingHandlerProc(userRoutine, message, theWindow, handlerRefCon, theDrag)        \
  245.         (*(userRoutine))((message), (theWindow), (handlerRefCon), (theDrag))
  246. #endif
  247. typedef pascal OSErr (*DragReceiveHandlerProcPtr)(WindowPtr theWindow, void *handlerRefCon, DragReference theDrag);
  248.  
  249. #if GENERATINGCFM
  250. typedef UniversalProcPtr DragReceiveHandlerUPP;
  251. #else
  252. typedef DragReceiveHandlerProcPtr DragReceiveHandlerUPP;
  253. #endif
  254.  
  255. enum {
  256.     uppDragReceiveHandlerProcInfo = kPascalStackBased
  257.          | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  258.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(WindowPtr)))
  259.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(void *)))
  260.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(DragReference)))
  261. };
  262.  
  263. #if GENERATINGCFM
  264. #define NewDragReceiveHandlerProc(userRoutine)        \
  265.         (DragReceiveHandlerUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppDragReceiveHandlerProcInfo, GetCurrentArchitecture())
  266. #else
  267. #define NewDragReceiveHandlerProc(userRoutine)        \
  268.         ((DragReceiveHandlerUPP) (userRoutine))
  269. #endif
  270.  
  271. #if GENERATINGCFM
  272. #define CallDragReceiveHandlerProc(userRoutine, theWindow, handlerRefCon, theDrag)        \
  273.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppDragReceiveHandlerProcInfo, (theWindow), (handlerRefCon), (theDrag))
  274. #else
  275. #define CallDragReceiveHandlerProc(userRoutine, theWindow, handlerRefCon, theDrag)        \
  276.         (*(userRoutine))((theWindow), (handlerRefCon), (theDrag))
  277. #endif
  278. /*
  279. _________________________________________________________________________________________________________
  280.     
  281.  * APPLICATION-DEFINED ROUTINES
  282. _________________________________________________________________________________________________________
  283. */
  284. typedef pascal OSErr (*DragSendDataProcPtr)(FlavorType theType, void *dragSendRefCon, ItemReference theItemRef, DragReference theDrag);
  285.  
  286. #if GENERATINGCFM
  287. typedef UniversalProcPtr DragSendDataUPP;
  288. #else
  289. typedef DragSendDataProcPtr DragSendDataUPP;
  290. #endif
  291.  
  292. enum {
  293.     uppDragSendDataProcInfo = kPascalStackBased
  294.          | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  295.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(FlavorType)))
  296.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(void *)))
  297.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(ItemReference)))
  298.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(DragReference)))
  299. };
  300.  
  301. #if GENERATINGCFM
  302. #define NewDragSendDataProc(userRoutine)        \
  303.         (DragSendDataUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppDragSendDataProcInfo, GetCurrentArchitecture())
  304. #else
  305. #define NewDragSendDataProc(userRoutine)        \
  306.         ((DragSendDataUPP) (userRoutine))
  307. #endif
  308.  
  309. #if GENERATINGCFM
  310. #define CallDragSendDataProc(userRoutine, theType, dragSendRefCon, theItemRef, theDrag)        \
  311.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppDragSendDataProcInfo, (theType), (dragSendRefCon), (theItemRef), (theDrag))
  312. #else
  313. #define CallDragSendDataProc(userRoutine, theType, dragSendRefCon, theItemRef, theDrag)        \
  314.         (*(userRoutine))((theType), (dragSendRefCon), (theItemRef), (theDrag))
  315. #endif
  316. #endif
  317. #if FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE
  318. typedef pascal OSErr (*DragInputProcPtr)(Point *mouse, SInt16 *modifiers, void *dragInputRefCon, ScrapRef theDrag);
  319.  
  320. #if GENERATINGCFM
  321. typedef UniversalProcPtr DragInputUPP;
  322. #else
  323. typedef DragInputProcPtr DragInputUPP;
  324. #endif
  325.  
  326. enum {
  327.     uppDragInputProcInfo = kPascalStackBased
  328.          | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  329.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(Point *)))
  330.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(SInt16 *)))
  331.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(void *)))
  332.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(ScrapRef)))
  333. };
  334.  
  335. #if GENERATINGCFM
  336. #define NewDragInputProc(userRoutine)        \
  337.         (DragInputUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppDragInputProcInfo, GetCurrentArchitecture())
  338. #else
  339. #define NewDragInputProc(userRoutine)        \
  340.         ((DragInputUPP) (userRoutine))
  341. #endif
  342.  
  343. #if GENERATINGCFM
  344. #define CallDragInputProc(userRoutine, mouse, modifiers, dragInputRefCon, theDrag)        \
  345.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppDragInputProcInfo, (mouse), (modifiers), (dragInputRefCon), (theDrag))
  346. #else
  347. #define CallDragInputProc(userRoutine, mouse, modifiers, dragInputRefCon, theDrag)        \
  348.         (*(userRoutine))((mouse), (modifiers), (dragInputRefCon), (theDrag))
  349. #endif
  350. typedef pascal OSErr (*DragDrawingProcPtr)(DragRegionMessage message, RgnHandle showRegion, Point showOrigin, RgnHandle hideRegion, Point hideOrigin, void *dragDrawingRefCon, ScrapRef theDrag);
  351.  
  352. #if GENERATINGCFM
  353. typedef UniversalProcPtr DragDrawingUPP;
  354. #else
  355. typedef DragDrawingProcPtr DragDrawingUPP;
  356. #endif
  357.  
  358. enum {
  359.     uppDragDrawingProcInfo = kPascalStackBased
  360.          | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  361.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(DragRegionMessage)))
  362.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(RgnHandle)))
  363.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(Point)))
  364.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(RgnHandle)))
  365.          | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(Point)))
  366.          | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(void *)))
  367.          | STACK_ROUTINE_PARAMETER(7, SIZE_CODE(sizeof(ScrapRef)))
  368. };
  369.  
  370. #if GENERATINGCFM
  371. #define NewDragDrawingProc(userRoutine)        \
  372.         (DragDrawingUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppDragDrawingProcInfo, GetCurrentArchitecture())
  373. #else
  374. #define NewDragDrawingProc(userRoutine)        \
  375.         ((DragDrawingUPP) (userRoutine))
  376. #endif
  377.  
  378. #if GENERATINGCFM
  379. #define CallDragDrawingProc(userRoutine, message, showRegion, showOrigin, hideRegion, hideOrigin, dragDrawingRefCon, theDrag)        \
  380.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppDragDrawingProcInfo, (message), (showRegion), (showOrigin), (hideRegion), (hideOrigin), (dragDrawingRefCon), (theDrag))
  381. #else
  382. #define CallDragDrawingProc(userRoutine, message, showRegion, showOrigin, hideRegion, hideOrigin, dragDrawingRefCon, theDrag)        \
  383.         (*(userRoutine))((message), (showRegion), (showOrigin), (hideRegion), (hideOrigin), (dragDrawingRefCon), (theDrag))
  384. #endif
  385. #endif
  386. #if FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED
  387. /*
  388. _________________________________________________________________________________________________________
  389.     
  390.  * INSTALLING AND REMOVING HANDLERS API'S
  391. _________________________________________________________________________________________________________
  392. */
  393. extern pascal OSErr InstallTrackingHandler(DragTrackingHandlerUPP trackingHandler, WindowPtr theWindow, void *handlerRefCon)
  394.  TWOWORDINLINE(0x7001, 0xABED);
  395.  
  396. extern pascal OSErr InstallReceiveHandler(DragReceiveHandlerUPP receiveHandler, WindowPtr theWindow, void *handlerRefCon)
  397.  TWOWORDINLINE(0x7002, 0xABED);
  398.  
  399. extern pascal OSErr RemoveTrackingHandler(DragTrackingHandlerUPP trackingHandler, WindowPtr theWindow)
  400.  TWOWORDINLINE(0x7003, 0xABED);
  401.  
  402. extern pascal OSErr RemoveReceiveHandler(DragReceiveHandlerUPP receiveHandler, WindowPtr theWindow)
  403.  TWOWORDINLINE(0x7004, 0xABED);
  404.  
  405. /*
  406. _________________________________________________________________________________________________________
  407.     
  408.  * CREATING & DISPOSING
  409. _________________________________________________________________________________________________________
  410. */
  411. extern pascal OSErr NewDrag(DragReference *theDrag)
  412.  TWOWORDINLINE(0x7005, 0xABED);
  413.  
  414. extern pascal OSErr DisposeDrag(DragReference theDrag)
  415.  TWOWORDINLINE(0x7006, 0xABED);
  416.  
  417. /*
  418. _________________________________________________________________________________________________________
  419.     
  420.  * ADDING DRAG ITEM FLAVORS
  421. _________________________________________________________________________________________________________
  422. */
  423. extern pascal OSErr AddDragItemFlavor(DragReference theDrag, ItemReference theItemRef, FlavorType theType, const void *dataPtr, Size dataSize, FlavorFlags theFlags)
  424.  TWOWORDINLINE(0x7007, 0xABED);
  425.  
  426. extern pascal OSErr SetDragItemFlavorData(DragReference theDrag, ItemReference theItemRef, FlavorType theType, const void *dataPtr, Size dataSize, UInt32 dataOffset)
  427.  TWOWORDINLINE(0x7009, 0xABED);
  428.  
  429. /*
  430. _________________________________________________________________________________________________________
  431.     
  432.  * PROVIDING CALLBACK PROCEDURES
  433. _________________________________________________________________________________________________________
  434. */
  435. extern pascal OSErr SetDragSendProc(DragReference theDrag, DragSendDataUPP sendProc, void *dragSendRefCon)
  436.  TWOWORDINLINE(0x700A, 0xABED);
  437.  
  438. #endif
  439. #if FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE
  440. extern pascal OSErr SetDragInputProc(ScrapRef theDrag, DragInputUPP inputProc, void *dragInputRefCon)
  441.  TWOWORDINLINE(0x700B, 0xABED);
  442.  
  443. extern pascal OSErr SetDragDrawingProc(ScrapRef theDrag, DragDrawingUPP drawingProc, void *dragDrawingRefCon)
  444.  TWOWORDINLINE(0x700C, 0xABED);
  445.  
  446. /*
  447. _________________________________________________________________________________________________________
  448.     
  449.  * SETTING THE DRAG IMAGE
  450. _________________________________________________________________________________________________________
  451. */
  452. extern OSStatus SetDragImage(ScrapRef theDrag, PixMapHandle imagePixMap, RgnHandle imageRgn, Point imageOffsetPt, DragImageFlags theImageFlags)
  453.  TWOWORDINLINE(0x7027, 0xABED);
  454.  
  455. #endif
  456. #if FOR_SYSTEM8_COOPERATIVE
  457. /*
  458. _________________________________________________________________________________________________________
  459.     
  460.  * SETTING THE DRAG IMAGE TRANSLUCENCY LEVEL
  461. _________________________________________________________________________________________________________
  462. */
  463. extern OSStatus SetDragImageTranslucency(ScrapRef theDrag, DragImageTranslucency newLevel);
  464.  
  465. /*
  466. _________________________________________________________________________________________________________
  467.     
  468.  * PERFORMING A DRAG
  469. _________________________________________________________________________________________________________
  470. */
  471. extern OSStatus TrackAEDrag(ScrapRef theDrag, AppleEvent *theEvent, RgnHandle theRegion);
  472.  
  473. #endif
  474. #if FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED
  475. extern pascal OSErr TrackDrag(DragReference theDrag, const EventRecord *theEvent, RgnHandle theRegion)
  476.  TWOWORDINLINE(0x700D, 0xABED);
  477.  
  478. /*
  479. _________________________________________________________________________________________________________
  480.     
  481.  * GETTING DRAG ITEM INFORMATION
  482. _________________________________________________________________________________________________________
  483. */
  484. extern pascal OSErr CountDragItems(DragReference theDrag, UInt16 *numItems)
  485.  TWOWORDINLINE(0x700E, 0xABED);
  486.  
  487. extern pascal OSErr GetDragItemReferenceNumber(DragReference theDrag, UInt16 index, ItemReference *theItemRef)
  488.  TWOWORDINLINE(0x700F, 0xABED);
  489.  
  490. extern pascal OSErr CountDragItemFlavors(DragReference theDrag, ItemReference theItemRef, UInt16 *numFlavors)
  491.  TWOWORDINLINE(0x7010, 0xABED);
  492.  
  493. extern pascal OSErr GetFlavorType(DragReference theDrag, ItemReference theItemRef, UInt16 index, FlavorType *theType)
  494.  TWOWORDINLINE(0x7011, 0xABED);
  495.  
  496. extern pascal OSErr GetFlavorFlags(DragReference theDrag, ItemReference theItemRef, FlavorType theType, FlavorFlags *theFlags)
  497.  TWOWORDINLINE(0x7012, 0xABED);
  498.  
  499. extern pascal OSErr GetFlavorDataSize(DragReference theDrag, ItemReference theItemRef, FlavorType theType, Size *dataSize)
  500.  TWOWORDINLINE(0x7013, 0xABED);
  501.  
  502. extern pascal OSErr GetFlavorData(DragReference theDrag, ItemReference theItemRef, FlavorType theType, void *dataPtr, Size *dataSize, UInt32 dataOffset)
  503.  TWOWORDINLINE(0x7014, 0xABED);
  504.  
  505. #endif
  506. #if FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE
  507. /*
  508. _________________________________________________________________________________________________________
  509.     
  510.  * DRAG ITEM BOUNDS
  511. _________________________________________________________________________________________________________
  512. */
  513. extern pascal OSErr GetDragItemBounds(ScrapRef theDrag, ItemReference theItemRef, Rect *itemBounds)
  514.  TWOWORDINLINE(0x7015, 0xABED);
  515.  
  516. extern pascal OSErr SetDragItemBounds(ScrapRef theDrag, ItemReference theItemRef, const Rect *itemBounds)
  517.  TWOWORDINLINE(0x7016, 0xABED);
  518.  
  519. /*
  520. _________________________________________________________________________________________________________
  521.     
  522.  * DROP LOCATIONS
  523. _________________________________________________________________________________________________________
  524. */
  525. extern pascal OSErr GetDropLocation(ScrapRef theDrag, AEDesc *dropLocation)
  526.  TWOWORDINLINE(0x7017, 0xABED);
  527.  
  528. extern pascal OSErr SetDropLocation(ScrapRef theDrag, const AEDesc *dropLocation)
  529.  TWOWORDINLINE(0x7018, 0xABED);
  530.  
  531. /*
  532. _________________________________________________________________________________________________________
  533.     
  534.  * GETTING INFORMATION ABOUT A DRAG
  535. _________________________________________________________________________________________________________
  536. */
  537. extern pascal OSErr GetDragAttributes(ScrapRef theDrag, DragAttributes *flags)
  538.  TWOWORDINLINE(0x7019, 0xABED);
  539.  
  540. extern pascal OSErr GetDragMouse(ScrapRef theDrag, Point *mouse, Point *globalPinnedMouse)
  541.  TWOWORDINLINE(0x701A, 0xABED);
  542.  
  543. extern pascal OSErr SetDragMouse(ScrapRef theDrag, Point globalPinnedMouse)
  544.  TWOWORDINLINE(0x701B, 0xABED);
  545.  
  546. extern pascal OSErr GetDragOrigin(ScrapRef theDrag, Point *globalInitialMouse)
  547.  TWOWORDINLINE(0x701C, 0xABED);
  548.  
  549. extern pascal OSErr GetDragModifiers(ScrapRef theDrag, SInt16 *modifiers, SInt16 *mouseDownModifiers, SInt16 *mouseUpModifiers)
  550.  TWOWORDINLINE(0x701D, 0xABED);
  551.  
  552. /*
  553. _________________________________________________________________________________________________________
  554.     
  555.  * DRAG HIGHLIGHTING
  556. _________________________________________________________________________________________________________
  557. */
  558. extern pascal OSErr ShowDragHilite(ScrapRef theDrag, RgnHandle hiliteFrame, Boolean inside)
  559.  TWOWORDINLINE(0x701E, 0xABED);
  560.  
  561. extern pascal OSErr HideDragHilite(ScrapRef theDrag)
  562.  TWOWORDINLINE(0x701F, 0xABED);
  563.  
  564. extern pascal OSErr DragPreScroll(ScrapRef theDrag, SInt16 dH, SInt16 dV)
  565.  TWOWORDINLINE(0x7020, 0xABED);
  566.  
  567. extern pascal OSErr DragPostScroll(ScrapRef theDrag)
  568.  TWOWORDINLINE(0x7021, 0xABED);
  569.  
  570. extern pascal OSErr UpdateDragHilite(ScrapRef theDrag, RgnHandle updateRgn)
  571.  TWOWORDINLINE(0x7022, 0xABED);
  572.  
  573. #endif
  574. /*
  575. _________________________________________________________________________________________________________
  576.     
  577.  * UTILITIES
  578. _________________________________________________________________________________________________________
  579. */
  580. #if FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED
  581. extern pascal Boolean WaitMouseMoved(Point initialMouse)
  582.  TWOWORDINLINE(0x7023, 0xABED);
  583.  
  584. #endif
  585. #if FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE
  586. extern pascal OSErr ZoomRects(const Rect *fromRect, const Rect *toRect, SInt16 zoomSteps, ZoomAcceleration acceleration)
  587.  TWOWORDINLINE(0x7024, 0xABED);
  588.  
  589. extern pascal OSErr ZoomRegion(RgnHandle region, Point zoomDistance, SInt16 zoomSteps, ZoomAcceleration acceleration)
  590.  TWOWORDINLINE(0x7025, 0xABED);
  591.  
  592. #endif
  593. #if FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED
  594. /*
  595. _________________________________________________________________________________________________________
  596.  * OLD NAMES
  597.    These are provided for compatiblity with older source bases.  It is recommended to not use them since
  598.      they may removed from this interface file at any time.
  599. _________________________________________________________________________________________________________
  600. */
  601.  
  602. enum {
  603.     dragHasLeftSenderWindow        = kDragHasLeftSenderWindow,        /* drag has left the source window since TrackDrag */
  604.     dragInsideSenderApplication    = kDragInsideSenderApplication,    /* drag is occurring within the sender application */
  605.     dragInsideSenderWindow        = kDragInsideSenderWindow        /* drag is occurring within the sender window */
  606. };
  607.  
  608.  
  609. enum {
  610.     dragTrackingEnterHandler    = kDragTrackingEnterHandler,    /* drag has entered handler */
  611.     dragTrackingEnterWindow        = kDragTrackingEnterWindow,        /* drag has entered window */
  612.     dragTrackingInWindow        = kDragTrackingInWindow,        /* drag is moving within window */
  613.     dragTrackingLeaveWindow        = kDragTrackingLeaveWindow,        /* drag has exited window */
  614.     dragTrackingLeaveHandler    = kDragTrackingLeaveHandler        /* drag has exited handler */
  615. };
  616.  
  617.  
  618. enum {
  619.     dragRegionBegin                = kDragRegionBegin,                /* initialize drawing */
  620.     dragRegionDraw                = kDragRegionDraw,                /* draw drag feedback */
  621.     dragRegionHide                = kDragRegionHide,                /* hide drag feedback */
  622.     dragRegionIdle                = kDragRegionIdle,                /* drag feedback idle time */
  623.     dragRegionEnd                = kDragRegionEnd                /* end of drawing */
  624. };
  625.  
  626.  
  627. enum {
  628.     zoomNoAcceleration            = kZoomNoAcceleration,            /* use linear interpolation */
  629.     zoomAccelerate                = kZoomAccelerate,                /* ramp up step size */
  630.     zoomDecelerate                = kZoomDecelerate                /* ramp down step size */
  631. };
  632.  
  633.  
  634. enum {
  635.     kDragStandardImage            = kDragStandardTranslucency,    /* 65% image translucency (standard)*/
  636.     kDragDarkImage                = kDragDarkTranslucency,        /* 50% image translucency*/
  637.     kDragDarkerImage            = kDragDarkerTranslucency,        /* 25% image translucency*/
  638.     kDragOpaqueImage            = kDragOpaqueTranslucency        /* 0% image translucency (opaque)*/
  639. };
  640.  
  641. #endif
  642.  
  643. #if PRAGMA_ALIGN_SUPPORTED
  644. #pragma options align=reset
  645. #endif
  646.  
  647. #if PRAGMA_IMPORT_SUPPORTED
  648. #pragma import off
  649. #endif
  650.  
  651. #ifdef __cplusplus
  652. }
  653. #endif
  654.  
  655. #endif /* __DRAG__ */
  656.  
  657.